package com.xvyy.tingshu.order.rpc;

import com.xvyy.tingshu.common.result.Result;
import com.xvyy.tingshu.model.order.OrderInfo;
import com.xvyy.tingshu.order.service.OrderInfoService;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * ClassName: OrderInfoRpcController
 * Package: com.xvyy.tingshu.order.rpc
 *
 * @Description:
 * @Author: xvyy
 * @Create: 2025/2/13 - 16:42
 * @Version: v1.0
 */
@RestController
@RequestMapping("/api/inner/orderInfo")
public class OrderInfoRpcController {

    @Autowired
    private OrderInfoService orderInfoService;

    @GetMapping("/getOrderInfo/{orderNo}")
    @Operation(summary = "根据订单号查询订单信息")
    Result<OrderInfo> getOrderInfo(@PathVariable(value = "orderNo") String orderNo) {
        OrderInfo orderInfo = orderInfoService.getOrderInfo(orderNo);
        return Result.ok(orderInfo);
    }
}
